 <?php
/**
 * DCRM PC Index Page
 *
 * This file is part of WEIPDCRM.
 * 
 * WEIPDCRM is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WEIPDCRM is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with WEIPDCRM.  If not, see <http://www.gnu.org/licenses/>.
 */

// For Rewrite Test
if($_SERVER['HTTP_USER_AGENT'] == 'DCRM-RewriteTest'){
	echo('OK');
	exit();
}

require_once('system/common.inc.php');
base_url();
// URL For Rewrite 

$rewrite_mod = get_option('rewrite_mod');
switch($rewrite_mod){
	case 3:
		$rewrite_url = array('public' => 'public-%d.html','ios9public' => 'public-list-iOS9-%d.html','down2' => 'downloads-list-%d.html','ios10public' => 'public-list-iOS10-%d.html','ios11public' => 'public-list-iOS11-%d.html','iospublic' => 'public-list-iOSClass-%d.html','search' => 'search-mfss.html','public_nohistory' => 'public/%d/nohistory', 'screenshot' => 'screenshot/%d', 'history' => 'history/%d', 'contact' => 'contact/%d', 'pcsection' => 'list-%d.html','7public' => 'public-SevenDay-%d.html','bpublic' => 'public-Halfyear-%d.html','30public' => 'public-OneMonth-%d.html','3public' => 'public-ThreeDay-%d.html','mipublic' => 'list-pg-%d.html','mipcpage' => 'list-%1$d-pg-%2$d.html', 'report' => 'report/%d', 'report_support' => 'report/%1$d/%2$d', 'more' => 'more/%d', 'more_offset' => 'more/%1$d/%2$d', 'misc' => 'misc','down' => 'downloads.html');
		break;
	case 1:
	case 2:
	default:
		$rewrite_url = array('view' => 'index.php?method=view&amp;pid=%d', 'view_nohistory' => 'index.php?pid=%d&amp;addr=nohistory', 'screenshot' => 'index.php?method=screenshot&amp;pid=%d', 'history' => 'index.php?method=history&amp;pid=%d', 'contact' => 'index.php?method=contact&amp;pid=%d', 'section' => 'index.php?method=section&amp;pid=%d', 'report' => 'index.php?method=report&amp;pid=%d', 'report_support' => 'index.php?method=report&amp;pid=%1$d&amp;support=%2$d', 'more' => 'index.php?method=more&amp;pid=%d', 'more_offset' => 'index.php?method=more&amp;pid=%1$d&amp;offset=%2$d', 'misc' => 'misc.php');
		break;
}
function echo_rewrite_url($type, $variable1, $variable2=''){
	global $rewrite_url;
	echo SITE_URL;
	printf($rewrite_url[$type], $variable1, $variable2);
}

if (file_exists('Release')) {
	$release = file('Release');
	$release_origin = __('No Name');
	$release_mtime = filemtime('Release');
	$release_time = date('Y-m-d H:i:s',$release_mtime);
	foreach ($release as $line) {
		if(preg_match('#^Origin#', $line)) {
			$release_origin = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
		if(preg_match("#^Description#", $line)) {
			$release_description = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
	}
} else {
	$release_origin = __('Empty Page');
}
if (isset($_GET['pid'])) {
	if (ctype_digit($_GET['pid']) && intval($_GET['pid']) <= 10000) {
		function device_check(){
			global $detect;
			$device_type = array('iPhone', 'iPod', 'iPad');
			for ($i = 0; $i < count($device_type); $i++) {
				$check = $detect->version($device_type[$i]);
				if ($check !== false) {
					if (isset($_SERVER['HTTP_X_MACHINE'])) {
						$DEVICE = $_SERVER['HTTP_X_MACHINE'];
					} else {
						$DEVICE = 'Unknown';
					}
					$OS = str_replace('_', '.', $check);
					break;
				}
			}
			return array('DEVICE' => $DEVICE, 'OS' => $OS);
		}

		if (isset($_GET['method']) && $_GET['method'] == 'screenshot') {
			$index = 2;
			$title = __('View Screenshots');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'report') {
			$device_info = device_check();
			if (!isset($_GET['support'])) {
				$index = 3;
			} else {
				if ($_GET['support'] == '1') {
					$support = 1;
				} elseif ($_GET['support'] == '2') {
					$support = 2;
				} elseif ($_GET['support'] == '3') {
					$support = 3;
				} else {
					$support = 0;
				}
				$index = 4;
			}
			$title = __('Report Problems');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'history') {
			$index = 5;
			$title = __('Version History');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'contact') {
			$index = 6;
			$title = __('Contact us');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'pcsection') {
			$index = 7;
			$title = __('Package Category');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'more') {
			$index = 8;
			$section = DB::fetch_first("SELECT `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections` WHERE `ID` = '".(int)$_GET['pid']."'");
			$q_name = DB::real_escape_string($section['Name']);
			if (isset($_GET['offset']) && !empty($_GET['offset']) && ctype_digit($_GET['offset'])) {
				$offset = intval($_GET['offset']);
			} else {
				$offset = 0;
			}
			$packages = DB::fetch_all("SELECT `ID`, `Name`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Section` = '".$q_name."') ORDER BY `ID` DESC LIMIT 10 OFFSET ".$offset);
			foreach($packages as $package){
				if(!empty($package)){
					if ($isCydia) { ?>
				<a href="cydia://package/<?php echo($package['Package']); ?>" target="_blank">
<?php					} else { ?>
				<li>
	<a href="<?php echo_rewrite_url('pc', $package['ID']);?>" class="app_icon" >
<?php					} ?>
	
    
<div class="desc" ><?php echo ($package['Description']);  ?></div>
</li>
<?php
				}
			}
			exit();
		} elseif (!isset($_GET['method']) || (isset($_GET['method']) && $_GET['method'] == 'public')) {
			$index = 1;
			$title = __('View Package');
			$package_id = (int)DB::real_escape_string($_GET['pid']);
			$package_info = DB::fetch_first("SELECT `Name`, `Version`, `Author`, `Package`, `Description`, `DownloadTimes`, `Multi`, `CreateStamp`, `Size`, `Installed-Size`, `Section`, `Homepage`, `Tag`, `Level`, `Price`, `Purchase_Link`, `Changelog`, `Changelog_Older_Shows`, `Video_Preview`, `System_Support`, `ScreenShots` FROM `".DCRM_CON_PREFIX."Packages` WHERE `ID` = '".$package_id."' LIMIT 1");
			if ($package_info) $title = $title.'  '.$package_info['Name'];
		} else {
			httpinfo(405);
			exit();
		}
	} else {
		httpinfo(405);
		exit();
	}
} elseif (!isset($_GET['method'])) {
	$index = 0;
	$title = $release_origin;
} else {
	httpinfo(405);
	exit();
}
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">  
  <head>
    <meta charset="utf-8">
    <meta name="title" content="Ai-小苹果™| 最简洁的中文源" />
    <title><?php echo($title); ?> | 最简洁的中文源</title>
<meta name="description" content="<?php echo($title); ?>| 最简洁的中文源,简单整洁有序的Cydia源,提供实用的DEB包。" />
    <meta name="robots" content="index, follow" />
    <meta name="baidu-site-verification" content="tkMGutKBb6" />
    <mobile:mobile type="pc,mobile"/>
    <link rel="shortcut icon" href="./favicon.ico">
    <link rel="stylesheet" type="text/css" href="./ziyuan/css/base.css" >
    <link rel="stylesheet" type="text/css" href="./ziyuan/css/rank.css" >
    <link rel="stylesheet" type="text/css" href="./ziyuan/css/index.css">

    <?php
if (defined("AUTOFILL_SEO")) {
?>
		<meta name="title" content="<?php echo(AUTOFILL_SEO); ?>" />
<?php
}
if (!empty($release_description)) {
?>
		<meta name="description" content="" />
<?php
}
if (defined("AUTOFILL_KEYWORDS")) {
?>
		<meta name ="keywords" content="<?php echo(AUTOFILL_KEYWORDS); ?>" />
<?php
}
if ($isCydia) {
?>
		<base target="_blank">
<?php
} else {
?>
		<base target="_top">
<?php
}
    ?>
  </head>  
  <body>
           
    <!-- Global Topbar -->
    <div class="global_topbar_wrap">
		<div id="global_topbar" class="global_topbar">
			<div class="wrap inner">
                    
<?php                                                                 
    if (defined("AUTOFILL_PCDBZDYMC1") or defined("AUTOFILL_PCDBZDY1") or defined("AUTOFILL_ZTMHDZ1") or defined("AUTOFILL_ZTMHDZMC1") or defined("AUTOFILL_YYWXZQ1") or defined("AUTOFILL_YYWXZQMC1") or defined("AUTOFILL_YYZJBB1") or defined("AUTOFILL_YYZJBBMC1") or defined("AUTOFILL_WLPJHZ1") or defined("AUTOFILL_WLPJHZMC1")) {
?>              
				<div class="services" id="global_topbar_services">
					<ul>
<?php
                                                                   
    if (defined("AUTOFILL_PCDBZDY1") && defined("AUTOFILL_PCDBZDYMC1")) {
?>                        
                    <li class="current"><a href="<?php echo(AUTOFILL_PCDBZDY1); ?>"><i class="weiphone"></i><?php echo(AUTOFILL_PCDBZDYMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_ZTMHDZ1") && defined("AUTOFILL_ZTMHDZMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_ZTMHDZ1); ?>" target="_blank"><i class="wegame"></i><?php echo(AUTOFILL_ZTMHDZMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYZJBB1") && defined("AUTOFILL_YYZJBBMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_YYZJBB1); ?>" target="_blank"><i class="fengbuy"></i><?php echo(AUTOFILL_YYZJBBMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_WLPJHZ1") && defined("AUTOFILL_WLPJHZMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_WLPJHZ1); ?>" target="_blank"><i class="wper"></i><?php echo(AUTOFILL_WLPJHZMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYWXZQ1") && defined("AUTOFILL_YYWXZQMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_YYWXZQ1); ?>" ><i class="weand"></i><?php echo(AUTOFILL_YYWXZQMC1); ?></a></li>
                     
<?php
	}
?>						
                     
					</ul>
					<a href="javascript:;" class="expand"><span>展开</span></a>
				</div>               
<?php
	}
?>	              
				<div class="links" id="globar_topbar_links">
					<ul>
						<li><a href="<?php echo(SITE_URL); ?>" target="_blank">首页</a></li>
<?php
	if (defined("AUTOFILL_PCDBZDY") && defined("AUTOFILL_PCDBZDY_NAME")) {
?>              
			<li><a href="<?php echo(AUTOFILL_PCDBZDY); ?>" target="_blank"><?php echo(AUTOFILL_PCDBZDY_NAME); ?></a></li> 
<?php
	}
?> 
					</ul>
					<div class="focus"><em></em></div>
				</div>
                <div class="user_menu">
				<ul>
<?php
require_once 'qqlogin/function.php';
require_once 'qqlogin/Connect2.1/qqConnectAPI.php';	
?>                  
<?php if(!isset($_SESSION["accesstoken"]) || !isset($_SESSION["openid"])) { ?>
		<li><a href="/qqlogin/qqlogin.php">登录</a></li>        
<?php } else { 
    $qc = new QC($_SESSION["accesstoken"],$_SESSION["openid"]);
    $arr = $qc->get_user_info();           
?>  
                <li><img class="icon" src="<?php echo $arr['figureurl_qq_2'];?>" style="border-radius: 50%; width: 20px; height: 20px; box-shadow:0 0 1px #AAA;padding:1px;margin-right: 1px;"></li> 
                <li>用户名：<?php echo $arr['nickname'];?></li>  
				<li><a href="User.php" target="_blank">个人中心</a></li>
                <li><a onclick="cookipost()" >退出登录</a></li>  
 <script language="javascript">
    function cookipost(){
      $.get("/qqlogin/qqlogout.php", function(result){
        alert('账户退出');
    	window.location.href='<?php echo(SITE_URL); ?>';
  	  });  
	}
</script>                  
<?php
}
?> 
                  
      
 <?php 
if(isset($_SESSION["accesstoken"]) || isset($_SESSION["openid"])) {      
$User=$arr["nickname"];
$Logo=$arr['figureurl_qq_2'];
$Openid=$_SESSION["openid"];
$date=date("Y-m-d h:i:s");
$ip = ($ip) ? $ip : $_SERVER["REMOTE_ADDR"];   
if($row=DB::result_first("SELECT * FROM `".DCRM_CON_PREFIX."User` WHERE `Openid`='".$Openid."'" )){    
  $sql = DB::query("UPDATE `".DCRM_CON_PREFIX."User` SET `Logo` = '".$Logo."', `User` = '".$User."',`IP` = '".$ip."' WHERE `Openid`='".$Openid."'");
} else {  
  $query = DB::query("INSERT INTO `".DCRM_CON_PREFIX."User` (ID,User,Logo,Openid,Packages,Collection,TimeStamp,IP) VALUES ('','$User','$Logo','$Openid','','','$date','$ip')");
}      
}
?> 
                 
				</ul>
			    </div>
			</div>
		</div>
	</div> 
<!-- Header -->
<div class="header_wrap">
	<div id="header" class="header">
		<div class="wrap_con header_inner">
			<h2><a href="<?php echo(SITE_URL); ?>"><?php echo(AUTOFILL_SEO); ?></a></h2>
			<div class="navigator">
				<ul>
					<li >
						<a href="<?php echo(SITE_URL); ?>">
							<i class="home"></i><span>首页</span>
						</a>
					</li>
					<li >
						<a href="<?php echo(SITE_URL); ?>public.php">
							<i class="list"></i><span>资源列表</span>
						</a>
					</li>
<?php
	if (defined("AUTOFILL_PCZDYDH") && defined("AUTOFILL_PCZDYDH_NAME")) {
?>                   
					<li >
						<a href="<?php echo(AUTOFILL_PCZDYDH); ?>">
							<i class="rank"></i><span><?php echo(AUTOFILL_PCZDYDH_NAME); ?></span>
						</a>
					</li>
<?php
    }                                                                     
    if (defined("AUTOFILL_PCZDYDH2") && defined("AUTOFILL_PCZDYDH2_NAME")) {
?>                   
					<li >
					     <a href="<?php echo(AUTOFILL_PCZDYDH2); ?>" >
						<i class="me"></i><span><?php echo(AUTOFILL_PCZDYDH2_NAME); ?></span>
                         </a>
					</li>
                           
<?php
    }                                                                     
?>   
				</ul>
			</div>
		</div>
	</div>
</div>          

    <!-- 以上为head永久不变 -->
    <!-- 变化开始 -->
    <!-- main8 Main -->
    <!--首页-->
    <!-- Banner -->
    <div id="home_banner" class="banner">
      <div class="inner">
        <ul>

         
<?php
	if (defined("AUTOFILL_PCLBT1")) {
?>            <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt1.png);">  
             <a class="wrap" href="<?php echo(AUTOFILL_PCZDYDH); ?>"  >
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt1.png" height="490" width="1700" alt="导航图片" /></a>
          </li> 
<?php
    }
    if (!defined("AUTOFILL_PCLBT1")) {
?>               <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt1.png);">  
               <a class="wrap" >
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt1.png" height="490" width="1700" alt="导航图片" /></a>
          </li>
<?php
    }                                                                     
    if (defined("AUTOFILL_PCLBT2")) {
?>      
          <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt2.png);">
            <a class="wrap" href="<?php echo(AUTOFILL_PCLBT2); ?>"  >   
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt2.png" height="490" width="1700" alt="导航图片" /></a>
          </li>
<?php
    }                                                                     
    if (!defined("AUTOFILL_PCLBT2")) {
?>      
          <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt2.png);">
            <a class="wrap" >   
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt2.png" height="490" width="1700" alt="导航图片" /></a>
          </li>          
<?php
    }                                                                     
    if (defined("AUTOFILL_PCLBT3")) {
?>           
          <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt3.png);">
            <a class="wrap" href="<?php echo(AUTOFILL_PCLBT3); ?>" >
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt3.png" height="490" width="1700" alt="导航图片" /></a>
          </li>
<?php
    }                                                                     
    if (!defined("AUTOFILL_PCLBT3")) {
?>           
          <li style="background-image: url(<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt3.png);">
            <a class="wrap" >
              <img src="<?php echo(SITE_URL); ?>manage/Speed/icon/pclbt3.png" height="490" width="1700" alt="导航图片" /></a>
          </li>          
<?php
    }                                                                     
?>          
        </ul>
      </div>
      <div class="controller">
        <div class="triggers">
          <a href="" class="current">1</a>
          <a href="">2</a>
          <a href="">3</a></div>
        <a href="" class="prev">Prev</a>
        <a href="" class="next">Next</a></div>
    </div>
    <!--第二部分-->
    <div class="clearfix module_group">
      <div class="clearfix wrap_con">
        <!--热门推荐-->
        <div class="hot_recome" id="hot_recommend">
          
          <h1>
            <span>热门推荐</span></h1>
          <ul>
            <li>
              <a href="<?php echo(AUTOFILL_BioProtect); ?>" class="thumbnail" title="BioProtect 指纹加密应用">
                <img src="./ziyuan/picture/1126.png" height="206" width="380" class="icon" alt="导航图片" />
                <i></i>
                <em class="add" ></em>
              </a>
              <div class="bottom_mask">
                <div class="bg_color"></div>
                <a href="<?php echo(AUTOFILL_BioProtect); ?>" class="app_ico">
                  <img src="./ziyuan/icon/gongju.png"  height="73" width="73" alt="导航图片" /></a>
                <div class="app_name">
                  <a href="<?php echo(AUTOFILL_BioProtect); ?>"  title="BioProtect 指纹加密应用">BioProtect</a></div>
                <div class="ratio">
                  <div class="ratio_img" style="width:1016.8%;"></div>
                  <div class="num_total">99+</div></div>
              </div>
            </li>
            <li>
              <a href="<?php echo(AUTOFILL_Springtomize); ?>" class="thumbnail" title="Springtomize 3 瑞士军刀">
                <img src="./ziyuan/picture/855.png" height="206" width="380" class="icon" alt="导航图片" />
                <i></i>
                <em class="add" ></em>
              </a>
              <div class="bottom_mask">
                <div class="bg_color"></div>
                <a href="<?php echo(AUTOFILL_Springtomize); ?>" class="app_ico">
                  <img src="./ziyuan/icon/gongju.png" height="73" width="73" alt="导航图片" /></a>
                <div class="app_name">
                  <a href="<?php echo(AUTOFILL_Springtomize); ?>"  title="Springtomize 3 瑞士军刀">Springtomize 3 </a></div>
                <div class="ratio">
                  <div class="ratio_img" style="width:1016.8%;"></div>
                  <div class="num_total">99+</div></div>
              </div>
            </li>
            <li>
              <a href="<?php echo(AUTOFILL_KuaiDial); ?>" class="thumbnail" title="KuaiDial iOS9 归属地 T9拨号">
                <img src="./ziyuan/picture/386.png" height="206" width="380" class="icon" alt="导航图片" />
                <i></i>
                <em class="add" ></em>
              </a>
              <div class="bottom_mask">
                <div class="bg_color"></div>
                <a href="<?php echo(AUTOFILL_KuaiDial); ?>" class="app_ico">
                  <img src="./ziyuan/icon/gongju.png" height="73" width="73" alt="导航图片" /></a>
                <div class="app_name">
                  <a href="<?php echo(AUTOFILL_KuaiDial); ?>" title="KuaiDial iOS9 归属地 T9拨号">KuaiDial 归属地</a></div>
                <div class="ratio">
                  <div class="ratio_img" style="width:1016.8%;"></div>
                  <div class="num_total">99+</div></div>
              </div>
            </li>
            <li>
              <a href="<?php echo(AUTOFILL_CCSettings); ?>"  class="thumbnail" title="CCSettings for iOS 8/9">
                <img src="./ziyuan/picture/384.png" height="206" width="380" class="icon" alt="导航图片"/>
                <i></i>
                <em class="add" ></em>
              </a>
              <div class="bottom_mask">
                <div class="bg_color"></div>
                <a href="<?php echo(AUTOFILL_CCSettings); ?>" class="app_ico">
                  <img src="./ziyuan/icon/gongju.png" height="73" width="73" alt="导航图片"/></a>
                <div class="app_name">
                  <a href="<?php echo(AUTOFILL_CCSettings); ?>" title="CCSettings for iOS 8/9" >CCSettings</a></div>
                <div class="ratio">
                  <div class="ratio_img" style="width:1016.8%;"></div>
                  <div class="num_total">99+</div></div>
              </div>
            </li>
          </ul>
<?php                                                                   
    if (!defined("AUTOFILL_PCLBT3")) {
?>          
          <div class="wea_d_770">
            <a target="_blank">
              <img src="./manage/Speed/icon/pctf.png"  width="768" height="96" alt="导航图片"/></a>
          </div>
             
<?php
    }                                                                     
    if (defined("AUTOFILL_PCLBT3")) {
?>          
          <div class="wea_d_770">
            <a href="<?php echo(AUTOFILL_PCTF); ?>" target="_blank">
              <img src="./manage/Speed/icon/pctf.png"  width="768" height="96" alt="导航图片"/></a>
          </div>
<?php
    }                                                                     
?>          
        </div>
        
        
			<div class="search_message">
  <div class="search_box">
				<form action="./search.php" method="get" >	
					<span class="txt">
						<input class="input" type="text" name="name"  placeholder="搜索你想要的" required="required" />
					</span>
					<span class="btn"><button type="submit" id="search_btn"><i></i>搜索</button></span>
				</form>
			</div>        
<?php
		if (DCRM_PCGGWKG == 1) {
?>              
				<div class="msg_box">
					<div class="scroll_msg">
						<h3>下载热度榜单TOP10</h3>
						
						<ul id="doing_ul" data-rollcount="10" data-url="index.php?r=site/moreFeed">
<?php
				$packages = DB::fetch_all("SELECT `ID`, `DownloadTimes`,  `Name`,`Description`, `Icon2`,`Section`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1') ORDER BY `DownloadTimes` DESC limit 0,10"  );
				foreach($packages as $package) {

?>                           
	                         <li>
								<div class="top_cit">
									<span class="user_head_line"></span>
									<a class="user_msg" href="<?php echo_rewrite_url('public', $package['ID']);?>" >
										<img src="<?php echo(SITE_URL); ?>icon/<?php echo($package['Icon2']); ?>" height="32" width="32" />
									<i></i>
									</a>
									<a class="user_name" href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank">插件“<?php echo($package['Name']); ?>”</a>
									<span class="new_time"></span>
								</div>
								<div class="msg_info">
									<i></i>
									<a href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank"><em></em>插件名称:“<?php echo($package['Name']); ?>”<br>总计下载量:<?php echo($package['DownloadTimes']); ?>次<br>点击前往查看</a>
								</div>
							</li>
<?php
    }                                                                     
?>                           
						</ul>
						<div class="msg_mask"></div>
					</div>
				</div>
			</div>
<?php
    }                                                                     
?> 

<?php
		if (DCRM_PCGGWKG == 2) {
?>

<?php                                                                   
    if (!defined("AUTOFILL_PCGGW")) {
?>          
        
        <div class="category_wea_d">    
          <a target="_blank">
            <img src="./manage/Speed/icon/ggwtp.png" width="280" height="500" alt="便民店铺" /></a>
        </div>
<?php
    }                                                                     
    if (defined("AUTOFILL_PCGGW")) {
?>         
        <div class="category_wea_d">    
          <a href="<?php echo(AUTOFILL_PCGGW); ?>" target="_blank">
            <img src="./manage/Speed/icon/ggwtp.png" width="280" height="500" alt="便民店铺" /></a>
        </div>  
<?php
    }                                                                     
    }                                                                     
?>   
      </div>
    </div>
<!--小编推荐-->
<div class="recommend clearfix">
	<div class="wrap_con">
		<div class="title">源主推荐</div>
		<div class="fantastic_soft">
				<ul> 			

<?php
				$packages = DB::fetch_all("SELECT `ID`, `DownloadTimes`, `Tjreason`,`PushStar`, `Name`,`Description`, `Icon2`,`Section`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Recommend` = '1') ORDER BY `CreateStamp` DESC limit 0,8"  );
				foreach($packages as $package) {
?>               
          
				   <li>
					<a href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank" class="thumbnail">
						<img  src="<?php echo(SITE_URL); ?>icon/<?php echo(empty($package['Icon2']) ? 'default/unknown.png' : $package['Icon2']); ?>"  height="118" width="118">
						<i></i>
						<em class="add"></em>
					</a>
                   <p class="soft_name"><a href="<?php echo_rewrite_url('public', $package['ID']);?>"target="_blank" title="<?php echo($package['Name']); ?>"><?php echo($package['Name']); ?></a></p>
					<div class="star_s"><span style="width:<?php echo($package['PushStar']); ?>%;"></span></div>
					<p class="bottom_cit"><a href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank"><?php echo($package['Tjreason']); ?></a></p>
                     </li>

<?php	
   } 
?>           
			</ul>         
    </div>
  </div>
</div>
		
	<div class="new_releases clearfix" id="new_releases">
		<div class="wrap_con">
			<h1>
				<span>最新上架</span>
			</h1>
			<div class="new_products">
				<ul style="left: -2224px;">
<?php
    
				$packages = DB::fetch_all("SELECT `ID`, `DownloadTimes`,  `Name`,`Description`, `Icon2`,`Section`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1') ORDER BY `CreateStamp` DESC limit 0,24"  );
				foreach($packages as $package) {
?>                 
					<li>
						<a href="<?php echo_rewrite_url('public', $package['ID']);?>" class="thumbnail">
							<img src="<?php echo(SITE_URL); ?>icon/<?php echo(empty($package['Icon2']) ? 'default/unknown.png' : $package['Icon2']); ?>" height="118" width="118" class="icon" alt="软件分类图标"/>
							<i></i>
                            <em class="add" ></em>
						</a>
						<p class="soft_name"><a href="<?php echo_rewrite_url('public', $package['ID']);?>"><?php echo($package['Name']); ?></a></p>
						<p>by:<a href="<?php echo(SITE_URL); ?>" class="user_name"><?php echo(AUTOFILL_SEO); ?></a></p>
					</li>
<?php	
   } 
?>                    
				</ul>
			</div>
			<div class="controller">
				<div class="triggers">
				<a href="javascript:;" class="">1</a>
				<a href="javascript:;" class="">2</a>
				<a href="javascript:;" class="">3</a>
				</div>
			</div>
		</div>
	</div>   
      
   
<?php                                                                    
    if (defined("AUTOFILL_WLPJHZ") or defined("AUTOFILL_WLPJHZMC") or defined("AUTOFILL_YYWXZQ") or defined("AUTOFILL_YYWXZQMC") or defined("AUTOFILL_YYZJBB") or defined("AUTOFILL_YYZJBBMC") or defined("AUTOFILL_ZTMHDZ") && defined("AUTOFILL_ZTMHDZ")) {
?>       
    <!--热门专辑-->
	<div class="hot_album clearfix" id="hot_album">
			<div class="wrap_con">
			<h1>
				<span>热门专辑</span>
			</h1>

		<div class="hot_album_wrap">
			<div class="hot_album_con">
				<ul>

<?php                                                                    
    }
    if (defined("AUTOFILL_WLPJHZ") && defined("AUTOFILL_WLPJHZMC")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_WLPJHZ); ?>" class="thumbnail" title="<?php echo(AUTOFILL_WLPJHZMC); ?>">
                  <img src="./ziyuan/picture/ios9jb.png" height="150" width="258" alt="<?php echo(AUTOFILL_WLPJHZMC); ?>" />
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_WLPJHZ); ?>" title="<?php echo(AUTOFILL_WLPJHZMC); ?>"><?php echo(AUTOFILL_WLPJHZMC); ?></a></p>
              </li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYWXZQ") && defined("AUTOFILL_YYWXZQMC")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_YYWXZQ); ?>" class="thumbnail" title="<?php echo(AUTOFILL_YYWXZQMC); ?>">
                  <img src="./ziyuan/picture/xin.png" height="150" width="258" alt="<?php echo(AUTOFILL_YYWXZQMC); ?>" />
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_YYWXZQ); ?>" title="<?php echo(AUTOFILL_YYWXZQMC); ?>"><?php echo(AUTOFILL_YYWXZQMC); ?></a></p>
              </li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYZJBB") && defined("AUTOFILL_YYZJBBMC")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_YYZJBB); ?>" class="thumbnail" title="<?php echo(AUTOFILL_YYZJBBMC); ?>">
                  <img src="./ziyuan/picture/necessary.png" height="150" width="258" alt="<?php echo(AUTOFILL_YYZJBBMC); ?>" />
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_YYZJBB); ?>" title="<?php echo(AUTOFILL_YYZJBBMC); ?>"><?php echo(AUTOFILL_YYZJBBMC); ?></a></p>
              </li>
<?php
    }                                                                     
    if (defined("AUTOFILL_ZTMHDZ") && defined("AUTOFILL_ZTMHDZMC")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_ZTMHDZ); ?>" class="thumbnail" title="<?php echo(AUTOFILL_ZTMHDZMC); ?>">
                  <img src="./ziyuan/picture/beauty.png" height="150" width="258" alt="<?php echo(AUTOFILL_ZTMHDZMC); ?>"/>
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_ZTMHDZ); ?>" title="<?php echo(AUTOFILL_ZTMHDZMC); ?>"><?php echo(AUTOFILL_ZTMHDZMC); ?></a></p>
              </li>
<?php
    }                                                                       
    if (defined("AUTOFILL_WLPJHZMC12") && defined("AUTOFILL_WLPJHZ12")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_WLPJHZ12); ?>" class="thumbnail" title="<?php echo(AUTOFILL_WLPJHZMC12); ?>">
                  <img src="./ziyuan/picture/ios9.png" height="150" width="258" alt="<?php echo(AUTOFILL_WLPJHZMC12); ?>"/>
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_WLPJHZ12); ?>" title="<?php echo(AUTOFILL_WLPJHZMC12); ?>"><?php echo(AUTOFILL_WLPJHZMC12); ?></a></p>
              </li>
<?php
    }                                                                  
    if (defined("AUTOFILL_YYWXZQMC12") && defined("AUTOFILL_YYWXZQ12")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_YYWXZQ12); ?>" class="thumbnail" title="<?php echo(AUTOFILL_YYWXZQMC12); ?>">
                  <img src="./ziyuan/picture/ios10.png" height="150" width="258" alt="<?php echo(AUTOFILL_YYWXZQMC12); ?>"/>
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_YYWXZQ12); ?>" title="<?php echo(AUTOFILL_YYWXZQMC12); ?>"><?php echo(AUTOFILL_YYWXZQMC12); ?></a></p>
              </li>
<?php
    }                                                           
    if (defined("AUTOFILL_YYZJBB12") && defined("AUTOFILL_YYZJBBMC12")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_YYZJBB12); ?>" class="thumbnail" title="<?php echo(AUTOFILL_YYZJBBMC12); ?>">
                  <img src="./ziyuan/picture/ios11.png" height="150" width="258" alt="<?php echo(AUTOFILL_YYZJBBMC12); ?>"/>
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_YYZJBB12); ?>" title="<?php echo(AUTOFILL_YYZJBBMC12); ?>"><?php echo(AUTOFILL_YYZJBBMC12); ?></a></p>
              </li>
<?php
    }                                                                     
    if (defined("AUTOFILL_ZTMHDZ12") && defined("AUTOFILL_ZTMHDZMC12")) {
?>              
              <li>
                <a href="<?php echo(AUTOFILL_ZTMHDZ12); ?>" class="thumbnail" title="<?php echo(AUTOFILL_ZTMHDZMC12); ?>">
                  <img src="./ziyuan/picture/osfl.png" height="150" width="258" alt="<?php echo(AUTOFILL_ZTMHDZMC12); ?>"/>
                  <i>
                  </i>
                  <em class="add" ></em>
                </a>
                <p class="soft_name">
                  <a href="<?php echo(AUTOFILL_ZTMHDZ12); ?>" title="<?php echo(AUTOFILL_ZTMHDZMC12); ?>"><?php echo(AUTOFILL_ZTMHDZMC12); ?></a></p>
              </li>              
            
 <?php
    }                                                                     
?>         
           </ul>
			</div>
			<div class="controller">
			<div class="triggers">
			<a href="javascript:;" class="current">1</a>
			<a href="javascript:;">2</a>
			</div>
			<a href="javascript:;" class="prev">Prev</a><a href="javascript:;" class="next">Next</a>
			</div>
		</div>
		</div>
	</div>

      
      
   
      
      
    <!-- footer -->
    <!--随便看看-->
<?php     
    if (defined("AUTOFILL_QXWZMC1") or defined("AUTOFILL_QXWZDZ1") or defined("AUTOFILL_QXWZMC2") or defined("AUTOFILL_QXWZDZ2") or defined("AUTOFILL_QXWZMC3") or defined("AUTOFILL_QXWZDZ3")) {
?>    
    <div class="footer">
      <div class="wrap_con">
        <h3>旗下网站</h3>
        <div class="footer_nav">
<?php
    }       
    if (defined("AUTOFILL_QXWZMC1") && defined("AUTOFILL_QXWZDZ1")) {
?>  
			<a href="<?php echo(AUTOFILL_QXWZDZ1); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC1); ?></a>
			|
<?php
    }                                                                     
    if (defined("AUTOFILL_QXWZMC2") && defined("AUTOFILL_QXWZDZ2")) {
?>            
			<a href="<?php echo(AUTOFILL_QXWZDZ2); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC2); ?></a>
			|
<?php
    }                                                                     
    if (defined("AUTOFILL_QXWZMC3") && defined("AUTOFILL_QXWZDZ3")) {
?>            
			<a class="hint-new" href="<?php echo(AUTOFILL_QXWZDZ3); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC3); ?></a>
		</div>
       
		<p><a href="http://www.miitbeian.gov.cn/" target="_blank">
          <?php if(defined("AUTOFILL_FOOTER_CODE")){ ?>
					<?php echo(stripslashes(AUTOFILL_FOOTER_CODE));?> </a></p>
		  <?php } ?>        
		<p><a  style="color: #c0392b;" >Copyright <?php printf( __( 'Copyright &copy; %s' ) , defined("AUTOFILL_FOOTER_YEAR") ? htmlspecialchars(stripslashes(AUTOFILL_FOOTER_YEAR)).'-'.date("Y") : date("Y") ); ?>  http:<?php echo(SITE_URL); ?> ®. All rights reserved. <?php echo(AUTOFILL_SEO); ?>版权或产权保护</a></p>
	</div>
    </div>
<?php
    }                                                                     
?>    
    <div class="bottom_fix">
      <!--返回顶部-->
      <a href="javascript:;" class="go_top" id="go_top_btn">返回顶部</a></div>
        <?php
	if (defined("AUTOFILL_BAIDUTJ")) {
?>
<?php echo(AUTOFILL_BAIDUTJ); ?>
<?php
	}
?>
    <script type="text/javascript" src="./ziyuan/js/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="./ziyuan/js/common.js"></script>
    <script type="text/javascript" src="./ziyuan/js/jquery.autoFixed.js"></script>
      <script type="text/javascript" src="./baohu.js"></script>
    <script type="text/javascript">//global options
      var STATIC_URL = './ziyuan/';
      $.ajaxSetup({
        cache: true
      });
      ds.Dialog.defaults.iconBasePath = 'images/';

      //Navigator autoFixed
      $.getScript(STATIC_URL + 'js/jquery.autoFixed.js',
      function() {
        $('#header').autoFixed();
      });

      //返回顶部
      jQuery(function($) {
        var timer, view = $(window),
        btn = $('#go_top_btn');

        function scrollHandler() {
          clearTimeout(timer);
          timer = setTimeout(checkScroll, 160);
        }
        function checkScroll() {
          var top = view.scrollTop();
          btn[top > 100 ? 'removeClass': 'addClass']('hide');
        }

        btn.bind('click',
        function() {
          btn.addClass('hide');
          ds.scrollTo(0);
        });
        view.bind('scroll', scrollHandler);
        scrollHandler();
      });</script>
    <script>$("div.inner > ul > li").eq(0).show().siblings("li").hide();
      $("div.triggers > a").mouseover(function() {
        clearInterval(timer);
        var _index = $(this).index();
        $(this).addClass("current").siblings().removeClass("current");
        $("div.inner > ul > li").eq(_index).fadeIn(1000).siblings("li").fadeOut(1000);
      });
      $("div.triggers > a").mouseout(function() {
        autoplay();
      });
      var _index = 0;
      var timer = null;
      function autoplay() {
        timer = setInterval(function() {
          _index++;
          if (_index < 3) {
            $("div.triggers > a").eq(_index).addClass("current").siblings().removeClass("current");
            $("div.inner > ul > li").eq(_index).fadeIn(1000).siblings("li").fadeOut(1000);
          } else {
            _index = -1;
          }

        },
        5000);
      };
      autoplay();
    </script>
    <script>(function(){
var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ac2ed4c8111f69164c6315f8f19a50da":"https://jspassport.ssl.qhimg.com/11.0.1.js?ac2ed4c8111f69164c6315f8f19a50da";
document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>
    <script type="text/javascript">	
	jQuery(function($){
		var baseUrl = window.STATIC_URL || './';
		$.getScript(baseUrl + 'ziyuan/js/jquery.FadeList.js', function(){
			var slider = ds.buildSlider('#home_banner', {
				delay: 6800,
				imgLoadFlag: [],
				imgLoadHandler: function(inx){
					var panel = this.items.eq(inx), img = panel.find('img');
					var url = img.attr('longDesc') || img.attr('src');

					panel.css('backgroundImage', 'url('+ url +')');
					img.attr('src', url);
				}
			}, window.FadeList);
		});
		
		ds.buildSlider('#new_releases', {
			length: Math.ceil($('#new_releases li').length/8),
			unitSize: 1112,
			duration: 500
		});
       ds.buildSlider('#new_releases2', {
			length: Math.ceil($('#new_releases2 li').length/6),
			unitSize: 1112,
			duration: 500
		});
      		ds.buildSlider('#hot_album', {
			length: Math.ceil($('#hot_album li').length/4),
			unitSize: 1112,
			duration: 500
		});
		
	});

	//marqueeSlider(doing & test_share)
	jQuery(function($){
		var
		global = window,
		marqueeSlider = function(shell){
			shell = $(shell);
			clearTimeout(shell.data('marquee_timer'));
			var
			timer,
			delay = 2480,
			target = shell.children().last(),
			height = target.height();
			target.hide().css('height', 0).css('opacity', 0).prependTo(shell).show();
			target.animate({height:height}, 720, 'linear')
			.animate({opacity:1}, 600, function(){
				shell.data('marquee_timer', setTimeout(function(){
					var
					count = ~~shell[0].marqueeCount,
					maxCount = 10; 
					shell[0].marqueeCount = count > maxCount ? 0 : count + 1;
					if(maxCount > 0 && count > maxCount){
						//Reload Data
						reloadData(shell);
					}
					else{
						marqueeSlider(shell);
					}
				}, delay));
			});
			if(!shell.data('has_marquee_handler')){
				shell.hover(function(){
					clearTimeout(shell.data('marquee_timer'));
				}, function(){
					shell.data('marquee_timer', setTimeout(function(){
						marqueeSlider(shell);
					}, delay));
				})
				.data('has_marquee_handler', true);
			}
		},
		//Reload Data Handler
		reloadData = function(shell){
			
			var url = shell.attr('data-url');
			url && $.get(url, function(data){
				
				var tmpl = $('#list_tmpl').val();
	     	   	var html = ds.tmpl(tmpl, data.info);
	     	   	shell.html(html);
				/* shell.html(data); */
				marqueeSlider(shell);
			},'json');
		};
		marqueeSlider('#doing_ul');
	});
</script>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>

    
  </body>
</html>